﻿/****************************************************************
  Author:  Ievgenii Nazaruk, ievgenii.nazaruk@gmail.com 
 License:  Microsoft Public License (Ms-PL)
          ( http://www.opensource.org/licenses/ms-pl.html or
            http://www.microsoft.com/opensource/licenses.mspx )
*****************************************************************/

using System;
using System.Globalization;
using System.Text;

namespace TableParsers
{
    public enum ParseType
    {
        BookTable,
        ReservedTable,
        WaitListTable,
        AttendedTable,
        CancelledTable
    }

    [Serializable]
    public class ClassTime
    {
        TimeSpan m_begin = new TimeSpan(0,0,0);
        public TimeSpan Begin
        {
            get
            {
                return m_begin;
            }
        }

        TimeSpan m_end = new TimeSpan(0, 0, 0);
        public TimeSpan End
        {
            get
            {
                return m_end;
            }
        }

        DateTime m_date = new DateTime();
        public DateTime Date
        {
            get
            {
                return m_date;
            }
        }

        public ClassTime(DateTime date, TimeSpan begin, TimeSpan end)
        {
            m_date = date;
            m_begin = begin;
            m_end = end;
        }        

        public override string ToString()
        {
            string date = m_date.ToShortDateString() ;
            string timeFormat ="{0,2:00}:{1,2:00}";
            string begin = String.Format(timeFormat, m_begin.Hours, m_begin.Minutes);
            string end = String.Format(timeFormat , m_end.Hours, m_end.Minutes);

            return date + " " + begin + " - " + end;
        }       
    }
}
